<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>28作业</title>
	<style>
	#kuang img{
		width: 150px;
		height: 150px;
	}

	</style>
	
	<script type="text/javascript">
	window.onload=function(){
		var star=document.getElementById("star");
			kuang=document.getElementById("kuang");

		var c=1
			a=2
		function run(){
			if (c==1) {
				width +=1;
				if (width>1000) {
					c=0;
				};

			}else{
				width -=1;
				if (width<10) {
					c=1;
				};
			}
			qiu.style.left=left+"px";
		}





		var go=1
			star.onclick=function(){
					if(go==1){
						time = setInterval(run, 10);
						star.value ="滚";
						go =0;
					}else{
						clearInterval(time);
						star.value ="滚";
						go =1;
						}
			}

	}



	var date1= '2017/01/01 00:00:00';
	var date2 = new Date(); 
	var date3 = date2.getTime() - new Date(date1).getTime();					 //相差毫秒数
	 var days=Math.floor(date3/(24*3600*1000))  
	 var leave1=date3%(24*3600*1000)   							 //计算天数后剩余的毫秒数  
    var hours=Math.floor(leave1/(3600*1000))  		 //计算相差分钟数  
    var leave2=leave1%(3600*1000)      						  //计算小时数后剩余的毫秒数  
    var minutes=Math.floor(leave2/(60*1000))  //计算相差秒数  
    var leave3=leave2%(60*1000)      //计算分钟数后剩余的毫秒数  
    var seconds=Math.round(leave3/1000)  
    document.write(" 相差 "+days+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒") 




	</script>

</head>
<body>
	<input type="button" value="滚" id="star">
	<div id="kuang"><img src="玩具球.jpg" alt="" id="qiu"></div>
</body>
</html>